//load vehicles
if (isNil "INV_vehicleArray") then
{
	INV_vehicleArray = [];
};


[] spawn
{
	if (count INV_vehicleArray <= 0) then
	{
		{
			[_x,vehiclesload] call INV_createVehicle;
			sleep 2;
		} forEach INV_savedVehicles;
	};
};

//save loop
while {true} do
{
	sleep 60;
	INV_savedVehicles = [];
	{	
		_vcl = _x;
		{
			if ((_vcl distance (_x select 0)) < (_x select 1)) then
			{
				INV_savedVehicles = INV_savedVehicles + [(typeOf _vcl)];
			};
		} forEach INV_VehicleGaragen;
	} forEach INV_vehicleArray;
	["INV_savedVehicles", INV_savedVehicles] call ClientSaveVar;	
};

